package single;

//饿汉式
//类一经加载就new出了一个实例，有可能造成空间浪费
public class Hungry {

    private Hungry(){}

    private static final Hungry hungry = new Hungry();

    public Hungry getInstance(){
        return hungry;
    }
}
